//================================================================
// 전역 번수 설정
//================================================================
var m_ContextName = "/";

var m_AnalysisType1 = 0;
var m_AnalysisType2 = 0;
var m_AnalysisType3 = 0;
var m_AnalysisType4 = 0;
//================================================================





//================================================================
// Util Function
//================================================================
function fnInitPage(strContext)
{
	m_ContextName = strContext;
}

function fnLoadChart()
{
	var intTotal = m_AnalysisType1 + m_AnalysisType2 + m_AnalysisType3 + m_AnalysisType4;
	
	var strText = "<br>&nbsp;&nbsp;&nbsp;검사된 Node 수 : " + intTotal + " 개<br>";
	strText = strText + "&nbsp;&nbsp;&nbsp;검사유형 : DB Injection / XSS / File Upload / CSRF";
	$('id_div_text').innerHTML = strText;
	
	//var w = $('id_tbl_chart').style.pixelWidth;
	//var h = $('id_tbl_chart').style.pixelHeight;
	
	var chart = new FusionCharts(m_ContextName + "/common/FusionChart/Pie2D.swf", "chart_main", "700", "350", "0", "0");
	
	var xmlData = "<chart palette='4' bgColor='99CCFF,FFFFFF' baseFontColor='000000' baseFontSize='15' numberSuffix='%25'>"
	xmlData = xmlData + "<set label='SQL Injection 취약점 ("+m_AnalysisType1+")' value='"+(m_AnalysisType1/intTotal)*100+"' />";
	xmlData = xmlData + "<set label='XSS(Cross Site Scripting) 취약점 ("+m_AnalysisType2+")' value='"+(m_AnalysisType2/intTotal)*100+"' isSliced='1' />";
	xmlData = xmlData + "<set label='파일 업로드 취약점 ("+m_AnalysisType3+")' value='"+(m_AnalysisType3/intTotal)*100+"' />";
	xmlData = xmlData + "<set label='CSRF 취약점 ("+m_AnalysisType4+")' value='"+(m_AnalysisType4/intTotal)*100+"' />";
	xmlData = xmlData + "</chart>";
	
	chart.setDataXML(xmlData);
	chart.render("id_div_chart");
}





















